<?php

namespace Modules\Express\Http\Controllers;

namespace Modules\Express\Http\Controllers;

use Catch\Base\CatchController as Controller;

use Illuminate\Http\Request;
use Modules\Express\Models\ExpressChannel;

class ExpressChannelController extends Controller
{
    public function __construct(
        protected readonly ExpressChannel $model
    ) {
    }
    /**
     * Display a listing of the resource.
     */
    public function index(): mixed
    {
        return $this->model->getList();
    }

    /**
     * @return mixed
     */
    public function store(Request $request)
    {
        $params = $request->all();
        return $this->model->storeBy($params);
    }

    /**
     * @param $id
     * @return mixed
     */
    public function show($id): mixed
    {
        return $this->model->firstBy($id);
    }

    /**
     * @param $id
     * @param Request $request
     * @return mixed
     */
    public function update($id, Request $request): mixed
    {
        $params = $request->all();
        return $this->model->updateBy($id, $params);
    }

    /**
     * Remove the specified resource from storage.
     */
    public function destroy(string $id)
    {
        //
    }
}
